FIX: parsing of string literals that contains //, closes #442#444
Conversation
//, closes #442//, closes #442
In the following code:
```cpp
main: () = {
{ std::cout << "//456"; } //error
:()->_ = { return "//Error"; };
b:="/* error even without {} block";
}
error: (x) -> _ = { return "//"; }
```
`//` and `/*` inside string literals are parsed as begining of comments.
Current change solves that. The missing is handling of raw string literals.
Closes hsutter#442
I thought #69 did that. |
|
Herb changed the parsing stages. There is a new simpler one that did not cover string literals not raw string literals. |
Could you remind me / elaborate? |
Hmmm... I made a mistake with this statement. I mistakenly treat a switch that is in the Now I see that the |
|
OK, thanks -- for now I've reopened #442 to track this part too, and the issue will then be re-closed via the coming new PR to apply the fix to raw strings. Again, thanks! |
…sutter#444) In the following code: ```cpp main: () = { { std::cout << "//456"; } //error :()->_ = { return "//Error"; }; b:="/* error even without {} block"; } error: (x) -> _ = { return "//"; } ``` `//` and `/*` inside string literals are parsed as begining of comments. Current change solves that. The missing is handling of raw string literals. Closes hsutter#442
In the following code:
main: () = { { std::cout << "//456"; } //error :()->_ = { return "//Error"; }; b:="/* error even without {} block"; } error: (x) -> _ = { return "//"; }//and/*inside string literals are parsed as the beginning of comments.Current change solves that. This FIX does not handle the handling of raw string literals.
Closes #442